﻿using System;

namespace Basics108_Methods
{
    /// <summary>
    /// Author: Mr. Jin Vincent N. Necesario
    /// Level: Beginner
    /// Problem: Write a method IntegerPower(base,exponent) that returns the value of base and exponent.
    /// e.g. IntegerPower(2,3) = 2 * 2 * 2. Do not use Math library method.
    /// </summary>
    class Program
    {
        static int IntegerPower(int baseNumber, int exponentNumber)
        {
            int power = 1;

            while (exponentNumber > 0) 
            {
                power *= baseNumber;
                exponentNumber--;
            }

            return power;
        }

        static void Main(string[] args)
        {
            
            Console.WriteLine(IntegerPower(2, 3));

            Console.ReadKey();
        }
    }
}
